home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume6 / xldimage / patch4 < prev    next >
Encoding:
Internet Message Format  |  1990-03-30  |  18.5 KB

  1. Path: uunet!snorkelwacker!apple!sun-barr!newstop!sun!harvard.harvard.edu!jimf%saber
  2. From: jimf%saber@harvard.harvard.edu
  3. Newsgroups: comp.sources.x
  4. Subject: REPOST: v06i057: xloadimage, Patch4
  5. Message-ID: <133718@sun.Eng.Sun.COM>
  6. Date: 30 Mar 90 18:02:08 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 543
  9. Approved: argv@sun.com
  10.  
  11. Submitted-by: jimf%saber@harvard.harvard.edu
  12. Posting-number: Volume 6, Issue 57
  13. Archive-name: xldimage/patch4
  14. Patch-To: xldimage: Volume 5, Issues 27,28,30
  15. Patch-To: xldimage: Volume 6, Issues 1,2
  16.  
  17. [ Reposted because I forgot to put the Patch-To: headers in... --dan ]
  18.  
  19. Following this message is a patch file to bring xloadimage patchlevel
  20. 03 up to patchlevel 04.
  21.  
  22. There are no new image formats in this patchlevel, but a number of
  23. bugs are fixed:
  24.  
  25.     * -quiet and -zoom now work in conjunction
  26.     * -border now works on monochrome displays
  27.     * -onroot calls now try to clean up after previous loads
  28.     * several calls to XCreateColormap were missing a parameter
  29.     * the Imakefile and Makefiles are slightly better
  30.     * an allocation error in newBitImage has been corrected
  31.  
  32. If you don't have patchlevel 03, it is available via anonymous ftp
  33. from expo.lcs.mit.edu in /contrib/xloadimage.1.03.tar.Z.  This patch
  34. is also available in /contrib/xloadimage.1.04.patch.Z.
  35.  
  36. Enjoy,
  37.  
  38. jim frost
  39. saber software
  40. jimf@saber.com
  41.  
  42. -- patch.04: cut here --
  43. diff -c xloadimage.03/Imakefile xloadimage.04/Imakefile
  44. *** xloadimage.03/Imakefile    Wed Dec 13 15:18:47 1989
  45. --- xloadimage.04/Imakefile    Fri Mar  2 19:02:00 1990
  46. ***************
  47. *** 1,6 ****
  48. !     SYSPATHFILE = $(USRLIBDIR)/xloadimagerc
  49.           DEFINES = -DSYSPATHFILE=\"$(SYSPATHFILE)\"
  50. !         DEPLIBS = $(DEPLIBS)
  51.   LOCAL_LIBRARIES = $(XLIB)
  52.              SRCS = bright.c clip.c compress.c dither.c faces.c fill.c \
  53.             gif.c halftone.c imagetypes.c merge.c misc.c new.c \
  54. --- 1,6 ----
  55. !     SYSPATHFILE = $(XAPPLOADDIR)/Xloadimage
  56.           DEFINES = -DSYSPATHFILE=\"$(SYSPATHFILE)\"
  57. !         DEPLIBS = $(DEPXLIB)
  58.   LOCAL_LIBRARIES = $(XLIB)
  59.              SRCS = bright.c clip.c compress.c dither.c faces.c fill.c \
  60.             gif.c halftone.c imagetypes.c merge.c misc.c new.c \
  61. ***************
  62. *** 14,16 ****
  63. --- 14,33 ----
  64.             xpixmap.o zio.o zoom.o
  65.   
  66.   ComplexProgramTarget(xloadimage)
  67. + install:: $(SYSPATHFILE)
  68. +     $(RM) $(BINDIR)/xview $(BINDIR)/xsetbg
  69. +     $(LN) $(BINDIR)/xloadimage $(BINDIR)/xview
  70. +     $(LN) $(BINDIR)/xloadimage $(BINDIR)/xsetbg
  71. + $(SYSPATHFILE):
  72. +     @echo "*** Creating default $(SYSPATHFILE) since you"
  73. +     @echo "*** don't have one. This file is used to set up default places"
  74. +     @echo "*** and names to look for images.  You probably want to edit"
  75. +     @echo "*** it for your site.  See the xloadimage manual page for"
  76. +     @echo "*** details on the contents of this file."
  77. +     cp /dev/null $(SYSPATHFILE)
  78. +     echo "path=$(LIBDIR)/bitmaps $(LIBDIR)/images" \
  79. +         >> $(SYSPATHFILE)
  80. +     echo "extension=.csun .msun .sun .face .xbm .bm .gif" \
  81. +         >>$(SYSPATHFILE)
  82. diff -c xloadimage.03/Makefile.gcc xloadimage.04/Makefile.gcc
  83. *** xloadimage.03/Makefile.gcc    Wed Jan  3 15:30:20 1990
  84. --- xloadimage.04/Makefile.gcc    Fri Mar  2 19:02:00 1990
  85. ***************
  86. *** 4,11 ****
  87.   #
  88.   # See file "copyright.h" for complete copyright information.
  89.   
  90.   CC= gcc
  91. ! CFLAGS= -O -fstrength-reduce -finline-functions -DSYSPATHFILE=\"/usr/lib/xloadimagerc\"
  92.   
  93.   LIBS= -lX11
  94.   OBJS= bright.o clip.o compress.o dither.o faces.o fill.o gif.o \
  95. --- 4,16 ----
  96.   #
  97.   # See file "copyright.h" for complete copyright information.
  98.   
  99. + SYSPATHFILE=/usr/lib/X11/Xloadimage
  100. + INSTALLDIR=/usr/bin/X11
  101.   CC= gcc
  102. ! CFLAGS= -O -fstrength-reduce -finline-functions -DSYSPATHFILE=\"$(SYSPATHFILE)\"
  103. ! CP= cp
  104. ! LN= ln -s
  105. ! RM= rm -f
  106.   
  107.   LIBS= -lX11
  108.   OBJS= bright.o clip.o compress.o dither.o faces.o fill.o gif.o \
  109. ***************
  110. *** 16,23 ****
  111. --- 21,48 ----
  112.   xloadimage: $(OBJS)
  113.       $(CC) $(CFLAGS) -o xloadimage $(OBJS) $(LIBS)
  114.   
  115. + install: $(SYSPATHFILE)
  116. +     $(RM) $(INSTALLDIR)/xloadimage
  117. +     $(RM) $(INSTALLDIR)/xsetbg
  118. +     $(RM) $(INSTALLDIR)/xview
  119. +     $(CP) xloadimage $(INSTALLDIR)/xloadimage
  120. +     $(LN) $(INSTALLDIR)/xloadimage $(INSTALLDIR)/xsetbg
  121. +     $(LN) $(INSTALLDIR)/xloadimage $(INSTALLDIR)/xview
  122.   clean:
  123.       rm -f *.o *~ xloadimage
  124.   
  125.   .c.o: xloadimage.h
  126.       $(CC) -c $(CFLAGS) $*.c
  127. + $(SYSPATHFILE):
  128. +     @echo "*** Creating default $(SYSPATHFILE) since you"
  129. +     @echo "*** don't have one. This file is used to set up default places"
  130. +     @echo "*** and names to look for images.  You probably want to edit"
  131. +     @echo "*** it for your site.  See the xloadimage manual page for"
  132. +     @echo "*** details on the contents of this file."
  133. +     cp /dev/null $(SYSPATHFILE)
  134. +     echo "path= /usr/local/images" \
  135. +         >> $(SYSPATHFILE)
  136. +     echo "extension=.csun .msun .sun .face .xbm .bm .gif" \
  137. +         >>$(SYSPATHFILE)
  138. diff -c xloadimage.03/Makefile.std xloadimage.04/Makefile.std
  139. *** xloadimage.03/Makefile.std    Wed Jan  3 15:30:10 1990
  140. --- xloadimage.04/Makefile.std    Fri Mar  2 19:02:00 1990
  141. ***************
  142. *** 4,11 ****
  143.   #
  144.   # See file "copyright.h" for complete copyright information.
  145.   
  146.   CC= cc
  147. ! CFLAGS= -O -DSYSPATHFILE=\"/usr/lib/xloadimagerc\"
  148.   
  149.   LIBS= -lX11
  150.   OBJS= bright.o clip.o compress.o dither.o faces.o fill.o gif.o \
  151. --- 4,16 ----
  152.   #
  153.   # See file "copyright.h" for complete copyright information.
  154.   
  155. + SYSPATHFILE=/usr/lib/X11/Xloadimage
  156. + INSTALLDIR=/usr/bin/X11
  157.   CC= cc
  158. ! CFLAGS= -O -DSYSPATHFILE=\"$(SYSPATHFILE)\"
  159. ! CP= cp
  160. ! LN= ln -s
  161. ! RM= rm -f
  162.   
  163.   LIBS= -lX11
  164.   OBJS= bright.o clip.o compress.o dither.o faces.o fill.o gif.o \
  165. ***************
  166. *** 16,23 ****
  167. --- 21,48 ----
  168.   xloadimage: $(OBJS)
  169.       $(CC) $(CFLAGS) -o xloadimage $(OBJS) $(LIBS)
  170.   
  171. + install: $(SYSPATHFILE)
  172. +     $(RM) $(INSTALLDIR)/xloadimage
  173. +     $(RM) $(INSTALLDIR)/xsetbg
  174. +     $(RM) $(INSTALLDIR)/xview
  175. +     $(CP) xloadimage $(INSTALLDIR)/xloadimage
  176. +     $(LN) $(INSTALLDIR)/xloadimage $(INSTALLDIR)/xsetbg
  177. +     $(LN) $(INSTALLDIR)/xloadimage $(INSTALLDIR)/xview
  178.   clean:
  179.       rm -f *.o *~ xloadimage
  180.   
  181.   .c.o: xloadimage.h
  182.       $(CC) -c $(CFLAGS) $*.c
  183. + $(SYSPATHFILE):
  184. +     @echo "*** Creating default $(SYSPATHFILE) since you"
  185. +     @echo "*** don't have one. This file is used to set up default places"
  186. +     @echo "*** and names to look for images.  You probably want to edit"
  187. +     @echo "*** it for your site.  See the xloadimage manual page for"
  188. +     @echo "*** details on the contents of this file."
  189. +     cp /dev/null $(SYSPATHFILE)
  190. +     echo "path= /usr/local/images" \
  191. +         >> $(SYSPATHFILE)
  192. +     echo "extension=.csun .msun .sun .face .xbm .bm .gif" \
  193. +         >>$(SYSPATHFILE)
  194. diff -c xloadimage.03/README xloadimage.04/README
  195. *** xloadimage.03/README    Wed Jan  3 12:41:10 1990
  196. --- xloadimage.04/README    Fri Mar  2 19:02:01 1990
  197. ***************
  198. *** 130,132 ****
  199. --- 130,142 ----
  200.   are not a multiple of 8.  Window.c was modified to avoid deleting the
  201.   default colormap, allowing proper operation on some servers prior to
  202.   X11R3 patchlevel 08.  There were many miscellaneous bug fixes.
  203. + Patchlevel 04 contained an enhancement to root.c to use
  204. + RetainTemporary and KillClient(disp, AllTemporary) so that it could
  205. + clean up after itself when reloading.  The -quiet and -zoom options no
  206. + longer cause garbage to be displayed for the image title.  A small bug
  207. + in new.c that caused incorrect allocation of bitmap images was fixed.
  208. + Several calls to XCreateColormap were missing the "visual" parameter
  209. + in send.c; this was fixed.  A bug relating to -border and monochrome
  210. + displays was fixed.  There were several changes to the Imakefile and
  211. + Makefiles.
  212. diff -c xloadimage.03/new.c xloadimage.04/new.c
  213. *** xloadimage.03/new.c    Wed Dec  6 14:56:08 1989
  214. --- xloadimage.04/new.c    Fri Mar  2 19:02:06 1990
  215. ***************
  216. *** 56,64 ****
  217.     image->width= width;
  218.     image->height= height;
  219.     image->depth= 1;
  220. !   linelen= width / 8;
  221. !   if (linelen % 8)
  222. !     linelen++;
  223.     image->data= (unsigned char *)lcalloc(linelen * height);
  224.     return(image);
  225.   }
  226. --- 56,62 ----
  227.     image->width= width;
  228.     image->height= height;
  229.     image->depth= 1;
  230. !   linelen= (width / 8) + (width % 8 ? 1 : 0); /* thanx johnh@amcc.com */
  231.     image->data= (unsigned char *)lcalloc(linelen * height);
  232.     return(image);
  233.   }
  234. diff -c xloadimage.03/patchlevel xloadimage.04/patchlevel
  235. *** xloadimage.03/patchlevel    Wed Jan  3 14:37:02 1990
  236. --- xloadimage.04/patchlevel    Fri Mar  2 19:02:06 1990
  237. ***************
  238. *** 2,5 ****
  239.    */
  240.   
  241.   #define VERSION    "1"
  242. ! #define PATCHLEVEL "03"
  243. --- 2,5 ----
  244.    */
  245.   
  246.   #define VERSION    "1"
  247. ! #define PATCHLEVEL "04"
  248. diff -c xloadimage.03/path.c xloadimage.04/path.c
  249. *** xloadimage.03/path.c    Wed Jan  3 15:33:01 1990
  250. --- xloadimage.04/path.c    Fri Mar  2 19:02:07 1990
  251. ***************
  252. *** 173,178 ****
  253. --- 173,179 ----
  254.     }
  255.     for (a= 0; a < NumPaths; a++) {
  256.       printf("%s:\n", Paths[a]);
  257. +     fflush(stdout);
  258.       sprintf(buf, "ls %s", Paths[a]);
  259.       if (system(buf) < 0) {
  260.         perror("ls");
  261. diff -c xloadimage.03/root.c xloadimage.04/root.c
  262. *** xloadimage.03/root.c    Wed Jan  3 15:34:57 1990
  263. --- xloadimage.04/root.c    Fri Mar  2 19:02:08 1990
  264. ***************
  265. *** 11,25 ****
  266.   #include "copyright.h"
  267.   #include "xloadimage.h"
  268.   
  269. ! void imageOnRoot(disp, scrn, image, install, verbose)
  270.        Display      *disp;
  271.        int           scrn;
  272.        Image        *image;
  273. -      unsigned int  install;
  274.        unsigned int  verbose;
  275.   { Pixmap   pixmap;
  276.     Colormap xcmap;
  277.   
  278.     if (! sendImageToX(disp, scrn, DefaultVisual(disp, scrn), image,
  279.                &pixmap, &xcmap, verbose))
  280.       exit(1);
  281. --- 11,34 ----
  282.   #include "copyright.h"
  283.   #include "xloadimage.h"
  284.   
  285. ! void imageOnRoot(disp, scrn, image, verbose)
  286.        Display      *disp;
  287.        int           scrn;
  288.        Image        *image;
  289.        unsigned int  verbose;
  290.   { Pixmap   pixmap;
  291.     Colormap xcmap;
  292.   
  293. +   /* xloadimage retains its information "temporarily" so that it can clean
  294. +    * up after itself.  this is supposed to clean up those resources on a
  295. +    * subsequent load.  may effect other clients.  a better way might be to
  296. +    * create a property and save the pixmap in it, exit retainpermanent, and
  297. +    * xkillclient the pixmap id if it exists.
  298. +    */
  299. +   XKillClient(disp, AllTemporary); /* kill temporarily held resources; used to
  300. +                     * clean up previous "onroot" loads */
  301.     if (! sendImageToX(disp, scrn, DefaultVisual(disp, scrn), image,
  302.                &pixmap, &xcmap, verbose))
  303.       exit(1);
  304. ***************
  305. *** 36,40 ****
  306.     XSetWindowBackgroundPixmap(disp, RootWindow(disp, scrn), pixmap);
  307.     XClearWindow(disp, RootWindow(disp, scrn));
  308.     XFreePixmap(disp, pixmap);
  309. !   XSetCloseDownMode(disp, RetainPermanent);
  310.   }
  311. --- 45,49 ----
  312.     XSetWindowBackgroundPixmap(disp, RootWindow(disp, scrn), pixmap);
  313.     XClearWindow(disp, RootWindow(disp, scrn));
  314.     XFreePixmap(disp, pixmap);
  315. !   XSetCloseDownMode(disp, RetainTemporary);
  316.   }
  317. diff -c xloadimage.03/send.c xloadimage.04/send.c
  318. *** xloadimage.03/send.c    Wed Jan  3 15:35:19 1990
  319. --- xloadimage.04/send.c    Fri Mar  2 19:02:08 1990
  320. ***************
  321. *** 81,90 ****
  322.     }
  323.     else {
  324.       if ((visual->class == PseudoColor) || (visual->class == GrayScale)) {
  325. !       *cmap= XCreateColormap(disp, RootWindow(disp, scrn), AllocNone);
  326.       }
  327.       else
  328. !       *cmap= XCreateColormap(disp, RootWindow(disp, scrn), AllocAll);
  329.       newmap= 1;
  330.     }
  331.   
  332. --- 81,90 ----
  333.     }
  334.     else {
  335.       if ((visual->class == PseudoColor) || (visual->class == GrayScale)) {
  336. !       *cmap= XCreateColormap(disp, RootWindow(disp, scrn), visual, AllocNone);
  337.       }
  338.       else
  339. !       *cmap= XCreateColormap(disp, RootWindow(disp, scrn), visual, AllocAll);
  340.       newmap= 1;
  341.     }
  342.   
  343. diff -c xloadimage.03/xloadimage.c xloadimage.04/xloadimage.c
  344. *** xloadimage.03/xloadimage.c    Wed Jan  3 15:36:19 1990
  345. --- xloadimage.04/xloadimage.c    Fri Mar  2 19:02:10 1990
  346. ***************
  347. *** 351,356 ****
  348. --- 351,372 ----
  349.         *dispimage->rgb.green= xcolor.green;
  350.         *dispimage->rgb.blue= xcolor.blue;
  351.       }
  352. +     /* bitmap needs both black and white
  353. +      */
  354. +     if (DefaultDepth(disp, scrn) == 1) {
  355. +     if (*(dispimage->rgb.red)) {
  356. +         *(dispimage->rgb.red + 1)= 0;
  357. +         *(dispimage->rgb.green + 1)= 0;
  358. +         *(dispimage->rgb.blue + 1)= 0;
  359. +     }
  360. +     else {
  361. +         *(dispimage->rgb.red + 1)= 65535;
  362. +         *(dispimage->rgb.green + 1)= 65535;
  363. +         *(dispimage->rgb.blue + 1)= 65535;
  364. +     }
  365. +     }
  366.       fill(dispimage, 0, 0, winwidth, winheight, 0);
  367.     }
  368.   
  369. ***************
  370. *** 388,394 ****
  371.     }
  372.   
  373.     if (onroot)
  374. !     imageOnRoot(disp, scrn, dispimage, install, verbose);
  375.     else
  376.       imageInWindow(disp, scrn, dispimage, winx, winy, winwidth, winheight,
  377.             install, verbose);
  378. --- 404,410 ----
  379.     }
  380.   
  381.     if (onroot)
  382. !     imageOnRoot(disp, scrn, dispimage, verbose);
  383.     else
  384.       imageInWindow(disp, scrn, dispimage, winx, winy, winwidth, winheight,
  385.             install, verbose);
  386. diff -c xloadimage.03/xloadimage.man xloadimage.04/xloadimage.man
  387. *** xloadimage.03/xloadimage.man    Wed Jan  3 15:51:00 1990
  388. --- xloadimage.04/xloadimage.man    Fri Mar  2 19:02:11 1990
  389. ***************
  390. *** 324,339 ****
  391.   .fi
  392.   .PP
  393.   Other contributing people include Barry Shein (bzs@std.com), Kirk L.
  394. ! Johnson (tuna@athena.mit.edu), Mark Snitilly (zok!mark@apple.com), and
  395.   W. David Higgins (wdh@mkt.csd.harris.com).
  396.   .SH FILES
  397.   .nf
  398.   .in +5
  399. ! xloadimage            - the image loader and viewer
  400. ! xsetbg                - pseudonym which quietly sets the background
  401. ! xview                 - pseudonym which views in a window
  402. ! /usr/lib/xloadimagerc - default system-wide configuration file
  403. ! ~/.xloadimagerc       - user's personal configuration file
  404.   .in -5
  405.   .fi
  406.   .SH COPYRIGHT
  407. --- 324,339 ----
  408.   .fi
  409.   .PP
  410.   Other contributing people include Barry Shein (bzs@std.com), Kirk L.
  411. ! Johnson (tuna@athena.mit.edu), Mark Snitily (zok!mark@apple.com), and
  412.   W. David Higgins (wdh@mkt.csd.harris.com).
  413.   .SH FILES
  414.   .nf
  415.   .in +5
  416. ! xloadimage              - the image loader and viewer
  417. ! xsetbg                  - pseudonym which quietly sets the background
  418. ! xview                   - pseudonym which views in a window
  419. ! /usr/lib/X11/Xloadimage - default system-wide configuration file
  420. ! \~/.xloadimagerc         - user's personal configuration file
  421.   .in -5
  422.   .fi
  423.   .SH COPYRIGHT
  424. ***************
  425. *** 370,380 ****
  426.   You cannot load an image onto the root window if the default visual is
  427.   not supported by \fIxloadimage\fR.
  428.   .PP
  429. ! If color images with substantially differing colormaps are loaded onto
  430. ! the root window, eventually there will be no more sharable colors in
  431. ! the default colormap and subsequent image loads onto the root window
  432. ! will fail.  This is the result of limitations within X and a lack of
  433. ! any protocol for handling root window and/or default colormap changes.
  434.   .PP
  435.   One of the pseudonyms for \fIxloadimage\fR, \fIxview\fR, is the same
  436.   name as Sun uses for their SunView-under-X package.  This will be
  437. --- 370,381 ----
  438.   You cannot load an image onto the root window if the default visual is
  439.   not supported by \fIxloadimage\fR.
  440.   .PP
  441. ! Images loaded onto the root window are retained with
  442. ! XSetCloseDownMode(disp, RetainTemporary) so that they can be easily
  443. ! cleaned out by future image loads.  Any application that does an
  444. ! XKillClient(disp, AllTemporary) will free up the root colormap (and
  445. ! things will get ugly).  Likewise, xloadimage will free up resources
  446. ! which other applications have retained via RetainTemporary.
  447.   .PP
  448.   One of the pseudonyms for \fIxloadimage\fR, \fIxview\fR, is the same
  449.   name as Sun uses for their SunView-under-X package.  This will be
  450. ***************
  451. *** 382,391 ****
  452.   XView.
  453.   .PP
  454.   Some window managers do not correctly handle window size requests.  In
  455. ! particular, versions of the twm window manager prior to X11R4 will use
  456.   the MaxSize hint instead of the PSize hint, causing images which
  457.   are larger than the screen to display in a window larger than the
  458. ! screen, something which is normally avoided.  These versions of twm
  459.   also ignore the MaxSize argument's real function, to limit the maximum
  460.   size of the window, and allow the window to be resized larger than the
  461.   image.  If this happens, \fIxloadimage\fR merely places the image in
  462. --- 383,392 ----
  463.   XView.
  464.   .PP
  465.   Some window managers do not correctly handle window size requests.  In
  466. ! particular, many versions of the twm window manager use
  467.   the MaxSize hint instead of the PSize hint, causing images which
  468.   are larger than the screen to display in a window larger than the
  469. ! screen, something which is normally avoided.  Some versions of twm
  470.   also ignore the MaxSize argument's real function, to limit the maximum
  471.   size of the window, and allow the window to be resized larger than the
  472.   image.  If this happens, \fIxloadimage\fR merely places the image in
  473. diff -c xloadimage.03/zoom.c xloadimage.04/zoom.c
  474. *** xloadimage.03/zoom.c    Wed Dec  6 15:21:20 1989
  475. --- xloadimage.04/zoom.c    Fri Mar  2 19:02:12 1990
  476. ***************
  477. *** 57,83 ****
  478.     if (!xzoom && !yzoom) /* stupid user */
  479.       return(NULL);
  480.   
  481. !   if (verbose) {
  482. !     if (!xzoom) {
  483.         printf("  Zooming image Y axis by %d%%...", yzoom);
  484.         sprintf(buf, "%s (Y zoom %d%%)", oimage->title, yzoom);
  485. !     }
  486. !     else if (!yzoom) {
  487.         printf("  Zooming image X axis by %d%%...", xzoom);
  488. !       sprintf(buf, "%s (X zoom %d%%)", oimage->title, xzoom);
  489. !     }
  490. !     else if (xzoom == yzoom) {
  491.         printf("  Zooming image by %d%%...", xzoom);
  492. !       sprintf(buf, "%s (%d%% zoom)", oimage->title, xzoom);
  493. !     }
  494. !     else {
  495.         printf("  Zooming image X axis by %d%% and Y axix by %d%%...",
  496.            xzoom, yzoom);
  497. !       sprintf(buf, "%s (X zoom %d%% Y zoom %d%%)", oimage->title,
  498. !           xzoom, yzoom);
  499. !     }
  500. !     fflush(stdout);
  501.     }
  502.   
  503.     xindex= buildIndex(oimage->width, xzoom, &xwidth);
  504.     yindex= buildIndex(oimage->height, yzoom, &ywidth);
  505. --- 57,86 ----
  506.     if (!xzoom && !yzoom) /* stupid user */
  507.       return(NULL);
  508.   
  509. !   if (!xzoom) {
  510. !     if (verbose)
  511.         printf("  Zooming image Y axis by %d%%...", yzoom);
  512.         sprintf(buf, "%s (Y zoom %d%%)", oimage->title, yzoom);
  513. !   }
  514. !   else if (!yzoom) {
  515. !     if (verbose)
  516.         printf("  Zooming image X axis by %d%%...", xzoom);
  517. !     sprintf(buf, "%s (X zoom %d%%)", oimage->title, xzoom);
  518. !   }
  519. !   else if (xzoom == yzoom) {
  520. !     if (verbose)
  521.         printf("  Zooming image by %d%%...", xzoom);
  522. !     sprintf(buf, "%s (%d%% zoom)", oimage->title, xzoom);
  523. !   }
  524. !   else {
  525. !     if (verbose)
  526.         printf("  Zooming image X axis by %d%% and Y axix by %d%%...",
  527.            xzoom, yzoom);
  528. !     sprintf(buf, "%s (X zoom %d%% Y zoom %d%%)", oimage->title,
  529. !         xzoom, yzoom);
  530.     }
  531. +   if (verbose)
  532. +     fflush(stdout);
  533.   
  534.     xindex= buildIndex(oimage->width, xzoom, &xwidth);
  535.     yindex= buildIndex(oimage->height, yzoom, &ywidth);
  536. dan
  537. -----------------------------------------------------------
  538.             O'Reilly && Associates
  539.         argv@sun.com / argv@ora.com
  540.        632 Petaluma Ave, Sebastopol, CA 95472 
  541.      800-338-NUTS, in CA: 800-533-NUTS, FAX 707-829-0104
  542.     Opinions expressed reflect those of the author only.
  543.